import request from '@/utils/request'

// 创建工单投料
export function createWorkOrderFeeding(data) {
  return request({
    url: '/production/work-order-feeding/create',
    method: 'post',
    data: data
  })
}

// 更新工单投料
export function updateWorkOrderFeeding(data) {
  return request({
    url: '/production/work-order-feeding/update',
    method: 'put',
    data: data
  })
}

// 删除工单投料
export function deleteWorkOrderFeeding(id) {
  return request({
    url: '/production/work-order-feeding/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除工单投料 */
export function deleteWorkOrderFeedingList(ids) {
  return request({
    url: `/production/work-order-feeding/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得工单投料
export function getWorkOrderFeeding(id) {
  return request({
    url: '/production/work-order-feeding/get?id=' + id,
    method: 'get'
  })
}

// 获得工单投料分页
export function getWorkOrderFeedingPage(params) {
  return request({
    url: '/production/work-order-feeding/page',
    method: 'get',
    params
  })
}
// 导出工单投料 Excel
export function exportWorkOrderFeedingExcel(params) {
  return request({
    url: '/production/work-order-feeding/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}